#ifndef FILELISTMODEL_H
#define FILELISTMODEL_H

#include <QAbstractListModel>
#include <QModelIndex>
#include <QModelIndexList>
#include "filelist_global.h"

class FILELISTSHARED_EXPORT FileListModel : public QAbstractListModel
{
//  Q_OBJECT

public:
  explicit FileListModel(QObject *parent = 0);

  // Basic functionality:
  int rowCount(const QModelIndex &parent = QModelIndex()) const override;

  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

  // Add data:
//  bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;

//  bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;

//  bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;

  QStringList fileList();

  void removeByIndexes(QModelIndexList indexList,  const QModelIndex &parent = QModelIndex());
  void removeByPaths(QStringList paths, const QModelIndex &parent = QModelIndex());
  void autoRemoveIllegalFiles();

private:
  QStringList _dataList;

public slots:
  void appendFiles(QStringList files);
  void clearAll();


};

#endif // FILELISTMODEL_H
